<!doctype html>
<html ng-app>
<head>
    <script src="http://code.angularjs.org/1.2.25/angular.min.js"></script>
</head>
<body>
<div ng-controller="Cntl2" class="expressions">
    Expression:
    <input type='text' ng-model="expr" size="80"/>
    <button ng-click="addExp(expr)">Evaluate</button>
    <ul>
        <li ng-repeat="expr in exprs track by $index">
            [ <a href="" ng-click="removeExp($index)">删除结果</a> ]
            <tt></tt> => <span ng-bind="$parent.$eval(expr)"></span>
        </li>
    </ul>
</div>
</body>
<script type="text/javascript">
    function Cntl2($scope) {
        var exprs = $scope.exprs = [];
        $scope.expr = '3*10|currency';
        $scope.addExp = function(expr) {
            exprs.push(expr);
        };

        $scope.removeExp = function(index) {
            exprs.splice(index, 1);
        };
    }
</script>
</html>